package net.brucecooper.mindmap.client;

public class Clip {
    int x1, x2, y1, y2;
    
    
    public Clip(int x1, int y1, int x2, int y2) {
        this.x1 = x1;
        this.x2 = x2;
        this.y1 = y1;
        this.y2 = y2;
    }
    
    public boolean intersects(int x, int y, int w, int h) {
        return ((x + w) > x1) && (x <= x2) && ((y + h) > y1) && (y <= y2); 
    }

    public Clip translate(int x, int y) {
        return new Clip(x1-x, y1-y, x2, y2);
    }
}
